/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package server;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.rmi.Naming;
import java.rmi.RemoteException;
import java.rmi.RMISecurityManager;
import java.rmi.server.UnicastRemoteObject;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import sun.rmi.server.Dispatcher;

/**
 *
 * @author JBP
 */
public abstract class MonitorImpl extends UnicastRemoteObject  {
    
    public MonitorImpl() throws RemoteException {
    }

    //methode pour connaitre la memoire libre,utilisée et totale
    public Memoire getMemory(String ip) throws RemoteException{
       Memoire mem = createMemoire(ip);
       return mem;
    }
    
    //methode pour connaitre le pourcentage de CPU utilisz
    public Cpu getCpu(String ip) throws RemoteException{
        Cpu cpu = createCpu(ip);
        return cpu;
    }
    
    public Processus getProcessus(String ip) throws RemoteException{
        Processus pro = createProcessus(ip);
        return pro;
    }
   
    public void supprimerHistorique() throws RemoteException{
        Bdd mabbd = new Bdd();
        mabbd.deleteHistory();
    }
    
    protected abstract Memoire createMemoire(String ip) throws RemoteException;
    protected abstract Cpu createCpu(String ip) throws RemoteException;
    protected abstract Processus createProcessus(String ip) throws RemoteException;

}
    
